{% extends "base.html" %}

{% block edit_form %}
<div class="form">

{% ifequal action 'new' %}
    <h3>Create new category</h3>
    <form method="POST" action="/tasktracker/category/new/">
{%else%}
    <h3>Edit category</h3>
    <form method="POST" action="/tasktracker/category/{{category.category_id}}/edit/">
{% endifequal %}

    <input type="hidden" name="category_id" value="{{category.category_id}}">
    {% for field in category %}
        <div class="fieldWrapper">
            <div class="field-error">{{ field.errors }}</div>
            <div class="field-label">{{ field.label_tag }}</div>
            <div class="field-value">{{ field }}</div>
        </div>
    {% endfor %}
    <input type="submit" value="Apply" />
</form>
</div>
{% endblock %}
